1. Field of the Invention
The present invention relates to an image processor and an image processing method, and more particularly, to an image processor and an image processing method for processing multilevel image data by an error diffusion method.
2. Description of the Related Art
Conventionally, for example, a technology of processing multilevel image data by use of the error diffusion method has been proposed as shown in Japanese Laid-open Patent Application No. H4-2271.
For example, image data representing the image density of each pixel with 8 bits, i.e. image data of 256 gradations are input as input data, and by comparing the image data with a plurality of threshold values, the number of gradations is reduced to that of image data representing the image density of each pixel with 4 bits, i.e. that of image data of 16 gradations. In this processing, the error diffusion method is used.
The error diffusion method is intended for, when the image is viewed as a whole, reducing the difference between the input image data and the output image data having undergone a conversion, i.e. an error caused by the conversion. Specifically, when a conversion is performed for a target pixel, an error or the difference between the pre-conversion value of the target pixel and the post-conversion value thereof is dispersed to pixels situated on the periphery of the target pixel to thereby restrain the error in the image as a whole.
However, the error diffusion method has the following problem:
According to the image data to be converted, streaks sometimes appear in the post-conversion image data. Specifically, the gradation level 16 of the input image data of 256 gradations completely corresponds to the gradation level 1 of the post-conversion image data of 16 gradations, so that no error is caused. On the contrary, for example, for the gradation level 8 of the 256-gradation image data, since it is situated between the gradation level 0 and the gradation level 1 of the 16-gradation image data, an error is caused irrespective of which level it is converted to. The error is dispersed to peripheral pixels. Consequently, image data having the gradation level 8 of the 256-gradation image data are alternately converted to the gradation level 0 and to the gradation level 1 of the 16-gradation image data, so that the image data are represented with the gradation level 0 and the gradation level 1 by dithering. Thus, in an image which changes with a gentle density gradient between gradation levels accurately represented without any errors and gradation levels represented by dithering, when the number of gradations is reduced by error diffusion, the boundaries appear as streaks.